import request  from '@/utils/request'

export interface categoryItemType {
  id:number,
  name:string,
  category2Id?:number,
  category1Id?:number
}

export type categoryType = categoryItemType[]

// 获取一级分类数据接口
export const reqCategory1 = () => (
  request.get<any,categoryType>(`/admin/product/getCategory1`)
)

// 二级分类
export const reqCategory2 = (category1Id:number) => (
  request.get<any,categoryType>(`/admin/product/getCategory2/${category1Id}`)
)

// 三级分类
export const reqCategory3 = (category2Id:number) => (
  request.get<any,categoryType>(`/admin/product/getCategory3/${category2Id}`)
)
